function response(data) {
  var viewer = data.get("viewer_profile").getData();
  var owner = data.get("owner").getData();
  
  var img = owner.getField(opensocial.Person.Field.THUMBNAIL_URL);
 	 var fullPic = img.replace(/small/g, "medium");
	 
  var OwnName = owner.getDisplayName();
  var cName = viewer.getDisplayName();
  var info = owner.getField(opensocial.Person.Field.STATUS);
  var myUrl= owner.getField(opensocial.Person.Field.PROFILE_URL);


		var profile_url = owner.getField(opensocial.Person.Field.PROFILE_URL);
		var regex = /uid=([^&#]+)/;
		var result = profile_url.match(regex);
  		  if (result.length == 2) {
   			   var uid = result[1];
    			} else {
   			 }
  
  
  		    document.getElementById("Profile-Picture").innerHTML='<img width="100%" src='+fullPic+'> '
			document.getElementById("Name").innerHTML=' '+OwnName+' '
			
			document.getElementById("Profile-ID").innerHTML=''+uid+'';
			document.getElementById("About").innerHTML=''+info+'';
			document.getElementById("Info").innerHTML=''+info+'';
			
};


function request() {
  var req = opensocial.newDataRequest();

  var params = {};
  params[opensocial.DataRequest.PeopleRequestFields.PROFILE_DETAILS] = [
	opensocial.Name.Field.GIVEN_NAME,
	opensocial.Person.Field.THUMBNAIL_URL,
	opensocial.Person.Field.ABOUT_ME,
	opensocial.Person.Field.STATUS,
	opensocial.Person.Field.PROFILE_URL
  ];

  req.add(req.newFetchPersonRequest("VIEWER", params), "viewer_profile");
  req.add(req.newFetchPersonRequest("OWNER", params), "owner");
  req.send(response);
};
request();
$('#Loading').fadeOut("slow");